<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>排班列表管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {

		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/phy/fSchedue/">排班列表列表</a></li>
<%--		<shiro:hasPermission name="phy:fSchedue:edit"><li><a href="${ctx}/phy/fSchedue/form">排班列表添加</a></li></shiro:hasPermission>--%>
	</ul>
	<form:form id="searchForm" modelAttribute="fSchedue" action="${ctx}/phy/fSchedue/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>年份：</label>
				<form:select path="scheduleYear" class="input-medium">
					<form:option value="" label="全部"/>
					<form:options items="${fns:getDictList('query_year')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</li>
			<li><label>月份：</label>
				<form:select path="scheduleMonth" class="input-medium">
					<form:option value="" label="全部"/>
					<form:options items="${fns:getDictList('query_month')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</li>

			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>序号</th>
				<th>时间</th>
				<c:forEach items="${templateList}" var="template" varStatus="i">
					<th> 班次${i.index +1 }</th>
				</c:forEach>
				<th>备注信息</th>
				<shiro:hasPermission name="phy:fSchedue:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="fSchedue" varStatus="i">
			<tr>
				<td>${i.index + 1}</td>
				<td>${fSchedue.scheduleYear}年${fSchedue.scheduleMonth}月${fSchedue.scheduleDay}日(${fSchedue.weekStr})</td>
				<c:forEach items="${templateList}" var="template" varStatus="n">
					<c:choose>
						<c:when test="${n.index eq 0}">
							<td>
								<c:if test="${not empty fSchedue.countA}">
									${fSchedue.titleA}(${fSchedue.beginDateA}-${fSchedue.endDateA})</br>
									剩余号源数:${fSchedue.countA}
								</c:if>
								<c:if test="${empty fSchedue.countA}">
									需要手动配置
								</c:if>
							</td>
						</c:when>
						<c:when test="${n.index eq 1}">
							<td>
								<c:if test="${not empty fSchedue.countB}">
									${fSchedue.titleB}(${fSchedue.beginDateB}-${fSchedue.endDateB})</br>
									剩余号源数:${fSchedue.countB}
								</c:if>
								<c:if test="${empty fSchedue.countB}">
									需要手动配置
								</c:if>
							</td>
						</c:when>
						<c:when test="${n.index eq 2}">
							<td>
								<c:if test="${not empty fSchedue.countC}">
									${fSchedue.titleC}(${fSchedue.beginDateC}-${fSchedue.endDateC})</br>
									剩余号源数:${fSchedue.countC}
								</c:if>
								<c:if test="${empty fSchedue.countC}">
									需要手动配置
								</c:if>
							</td>
						</c:when>
						<c:when test="${n.index eq 3}">
							<td>
								<c:if test="${not empty fSchedue.countD}">
									${fSchedue.titleD}(${fSchedue.beginDateD}-${fSchedue.endDateD})</br>
									剩余号源数:${fSchedue.countD}
								</c:if>
								<c:if test="${empty fSchedue.countD}">
									需要手动配置
								</c:if>
							</td>
						</c:when>
						<c:when test="${n.index eq 4}">
							<td>
								<c:if test="${not empty fSchedue.countE}">
									${fSchedue.titleE}(${fSchedue.beginDateE}-${fSchedue.endDateE})</br>
									剩余号源数:${fSchedue.countE}
								</c:if>
								<c:if test="${empty fSchedue.countE}">
									需要手动配置
								</c:if>
							</td>
						</c:when>
					</c:choose>
				</c:forEach>
				<td>
					${fSchedue.remarks}
				</td>
				<shiro:hasPermission name="phy:fSchedue:edit"><td>
    				<a href="${ctx}/phy/fSchedue/form?id=${fSchedue.id}">修改</a>
<%--					<a href="${ctx}/phy/fSchedue/delete?id=${fSchedue.id}" onclick="return confirmx('确认要删除该排班列表吗？', this.href)">删除</a>--%>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>
